const totalWidth = 200; // 总宽度
const negativeWidth = 100; // 负半轴宽度
const positiveWidth = totalWidth - negativeWidth; // 正半轴宽度

// 计算进度条宽度
const progressWidth =
  Math.min(Math.max(-30, -totalWidth / 2), totalWidth / 2) * 2;

const min = 0;
const max = 100;

const width = 300;

const value = 50;

option = {
  graphic: [
    {
      type: 'group',
      left: '0',
      top: '0',
      children: [
        {
          type: 'rect',
          shape: {
            x: 120,
            y: 0,
            width: width,
            height: 14,
            r: [10, 10, 10, 10]
          },
          style: {
            fill: '#25245D'
          },
          z: 0
        },
        // 进度条
        {
          type: 'rect',
          shape: {
            x: 120,
            y: 0,
            width: value, // 进度条的宽度
            height: 14,
            r: [10, 10, 10, 10]
          },
          style: {
            fill: '#FFA63F'
          },
          z: 1
        },

        {
          type: 'text',
          shape: {
            x: 0,
            y: 0,
            width: 120
          },
          style: {
            text: '最高单体电压',
            font: '16px Arial'
          },
          z: 2
        }
      ]
    }
  ]
};
